mudbox::RenderTarget Class Reference

#include <material.h>

Inheritance diagram for mudbox::RenderTarget:

Inheritance graph
[legend]
List of all members.

Detailed Description

RenderTarget is an abstraction of an OpenGL renderbuffer object.

You can attach multiple textures to the different 'slots' of this RenderTarget, to do multi-target rendering. Textures attached to slot0, slot1, slot2 and slot3 will all get the color; A Texture attached to slotDepth would get the zbuffer.


Public Types

enum   Slot {
  eSlotColor0 = 0, eSlotColor1, eSlotColor2, eSlotColor3,
  eSlotDepth, eSlotCount
}

Public Member Functions

virtual const mudbox::ClassDesc RuntimeClass (void) const
virtual void  DrawTexture (const class Texture *pTexture)
  Paints the given texture into the rendertarget, stretching or shrinking it to fill the available space.
virtual bool  Attach (mudbox::Texture *pTexture, Slot eSlot=eSlotColor0)
  Attaches a texture to the RenderTarget. The texture must have exactly the same size as the target.
virtual void  Detach (Slot eSlot=eSlotColor0)
  Detaches a texture from a slot in the rendertarget.
virtual mudbox::Texture Texture (Slot eSlot=eSlotColor0) const
  Returns the attached texture at a given slot.
virtual unsigned int  Width (void) const
  Returns the width of the rendertarget in pixels.
virtual unsigned int  Height (void) const
  Returns the height of the rendertarget in pixels.
virtual void  SetSize (unsigned int iWidth, unsigned int iHeight)
  Sets the size of the rendertarget in pixels.
virtual void  Activate (void)
  Makes this rendertarget active, but saves the previous one.
virtual void  Restore (void)
  Restores the previous rendertarget.
virtual void  SetMultisampling (bool bMultisampling)
  Set Multisample tag. To be removed.

Static Public Member Functions

const mudbox::ClassDesc StaticClass (void)
mudbox::Node CreateInstances (unsigned int iCount=1)

Member Enumeration Documentation

enum mudbox::RenderTarget::Slot
 
Enumeration values:
eSlotColor0 
eSlotColor1 
eSlotColor2 
eSlotColor3 
eSlotDepth 
eSlotCount 
00657     {
00658         eSlotColor0 = 0,
00659         eSlotColor1,
00660         eSlotColor2,
00661         eSlotColor3,
00662         eSlotDepth,
00663         eSlotCount      // placeholder for last position - not a type of slot
00664     };

Member Function Documentation

virtual const mudbox::ClassDesc* mudbox::RenderTarget::RuntimeClass void   )  const [inline, virtual]
 

Reimplemented from mudbox::Node.

00657 {
const mudbox::ClassDesc* mudbox::RenderTarget::StaticClass void   )  [static]
 

Reimplemented from mudbox::Node.

mudbox::Node* mudbox::RenderTarget::CreateInstances unsigned int  iCount = 1  )  [static]
 

Reimplemented from mudbox::Node.

virtual void mudbox::RenderTarget::DrawTexture const class Texture pTexture  )  [virtual]
 

Paints the given texture into the rendertarget, stretching or shrinking it to fill the available space.

virtual bool mudbox::RenderTarget::Attach mudbox::Texture pTexture,
Slot  eSlot = eSlotColor0
[virtual]
 

Attaches a texture to the RenderTarget. The texture must have exactly the same size as the target.

Parameters:
pTexture  [in] The texture to be attached to the RenderTarget
eSlot  [in] The slot to attach it to
virtual void mudbox::RenderTarget::Detach Slot  eSlot = eSlotColor0  )  [virtual]
 

Detaches a texture from a slot in the rendertarget.

Parameters:
eSlot  [in] The slot to detach a texture from
virtual mudbox::Texture* mudbox::RenderTarget::Texture Slot  eSlot = eSlotColor0  )  const [virtual]
 

Returns the attached texture at a given slot.

Parameters:
eSlot  [in] The id for the slot being queried
virtual unsigned int mudbox::RenderTarget::Width void   )  const [virtual]
 

Returns the width of the rendertarget in pixels.

virtual unsigned int mudbox::RenderTarget::Height void   )  const [virtual]
 

Returns the height of the rendertarget in pixels.

virtual void mudbox::RenderTarget::SetSize unsigned int  iWidth,
unsigned int  iHeight
[virtual]
 

Sets the size of the rendertarget in pixels.

virtual void mudbox::RenderTarget::Activate void   )  [virtual]
 

Makes this rendertarget active, but saves the previous one.

virtual void mudbox::RenderTarget::Restore void   )  [virtual]
 

Restores the previous rendertarget.

virtual void mudbox::RenderTarget::SetMultisampling bool  bMultisampling  )  [virtual]
 

Set Multisample tag. To be removed.


mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget
mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget mudbox::RenderTarget